package ws_contact

import "context"

type CheckInRequest struct {
	NodeId  string `json:"node_id" validate:"required"`
	DevId   string `json:"dev_id" validate:"omitempty"`
	Ip      string `json:"ip" validate:"omitempty"`
	Ipv6    string `json:"ipv6" validate:"omitempty"`
	Nat     int8   `json:"nat" validate:"required"`
	Port    int    `json:"port" validate:"required"`
	Region  string `json:"region" validate:"required"`
	Version string `json:"version" validate:"omitempty"`
}

type CheckInResponse struct {
	Status   bool `json:"status"`
	InterVal int  `json:"inter_val"`
}

type ReportRequest struct {
	NodeId     string `json:"node_id"`
	FreeDisk   int64  `json:"free_disk"`
	TotalDisk  int64  `json:"total_disk"`
	DataTotal  int64  `json:"data_total"`
	CpuPercent uint16 `json:"cpu_percent"`
	MemFree    uint16 `json:"mem_free"`
	PieceCount uint64 `json:"piece_count"`
}

type ContactCenter interface {
	CheckIn(ctx context.Context, req CheckInRequest) (res CheckInResponse, err error)
	Report(ctx context.Context, req ReportRequest) error
}
